#include <stdio.h>
#include <stdbool.h>

#define NUM_COLS 24
#define NUM_ROWS 7

bool search(const int a[], int n, int key);

int main(void)
{
    int temperatures[NUM_ROWS][NUM_COLS];
    int temp = 1;

    for (int i = 0; i < NUM_ROWS; i++)
    {
        for (int j = 0; j < NUM_COLS; j++)
            temperatures[i][j] = temp++;
    }

    bool result;
    int key = 32;

    result = search(temperatures[0], NUM_ROWS * NUM_ROWS, key);

    if (result)
        printf("The number %d exists", key);
    else
        printf("Not found %d", temp);
}

bool search(const int a[], int n, int key)
{
    const int *p;

    for (p = a; p < a + n; p++)
    {
        if (*p == key)
            return true;
    }

    return false;
}
